package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 充值订单表
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-05-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_order")
public class GuOrder extends Model<GuOrder> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "order_id", type = IdType.AUTO)
    private Long orderId;

    /**
     * 订单号
     */
    private String orderSn;

    /**
     * 用户id
     */
    private Long orderUserId;

    /**
     * steamId
     */
    private String orderSteamId;

    /**
     * 用户昵称
     */
    private String orderUserNickname;

    /**
     * 支付金额
     */
    private BigDecimal orderPayAmount;

    /**
     * 订单状态
     */
    private Integer orderState;

    /**
     * 充值金额
     */
    private BigDecimal orderAmount;

    /**
     * 优惠券码id
     */
    private Integer orderCouponId;

    /**
     * 优惠券码
     */
    private String orderCouponCode;

    /**
     * 邀请码
     */
    private Long orderInviteUserId;
    private String orderInviteSteamId;
    private String orderInviteCode;

    /**
     * 支付回调时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderPayCallbackTime;

    /**
     * 订单错误信息描述
     */
    private String orderMsg;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderRefundCallbackTime;

    /**
     * 订单退款错误信息
     */
    private String orderRefundMsg;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderCreateTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderUpdateTime;


    @Override
    protected Serializable pkVal() {
        return this.orderId;
    }

}
